<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/11
 * Time: 14:06
 */
namespace Admin\Controller;
use Base\Controller\CurdController;
use Think\Cache\Driver\Db;

class BaseinfoVersionController extends CurdController
{
    public function __construct()
    {
        parent::__construct();

    }
    /**
     * 获取所有数据并注入模板
     * */
    protected function getAll()
    {
        if($_REQUEST['keyword']){
            $map['name'] = array('like','%'.$_REQUEST['keyword'].'%');
            $where['_complex'] = $map;
        }
        $where['status']=1;
        if($_REQUEST['selects']){
            $limit=$_REQUEST['selects'];
        }else{
            $limit=20;
        }
        $data = $this->model->pageToView($limit, true,$where);
        $this->assign("page", $data['page']);
        $this->assign("list", $data['list']);
    }
}